﻿using RuoVea.ExSugar.Attributes;
using RuoVea.ExSugar.Entity;
using SqlSugar;
using System.ComponentModel;

namespace RuoVea.OmiApi.Article.Entitys;

/// <summary>
/// 分类-文章中间表（多对多关系）
/// </summary>
[SugarTable(nameof(ArtCategoryArticle), TableDescription = "分类-文章关联表")]
[Description("分类-文章关联表")] 
[SugarIndex($"IX_{nameof(ArtCategoryArticle)}_{nameof(CategoryId)}", nameof(CategoryId), OrderByType.Asc)]
[SugarIndex($"IX_{nameof(ArtCategoryArticle)}_{nameof(ArticleId)}", nameof(ArticleId), OrderByType.Asc)]
public class ArtCategoryArticle : AutoKeyBase
{
    /// <summary>
    /// 分类ID
    /// </summary>
    [ConfigSugarColumn(columnKey: nameof(CategoryId), columnDescription :"分类ID")]
    public long CategoryId { get; set; }

    /// <summary>
    /// 文章ID
    /// </summary>
    [ConfigSugarColumn(columnKey: nameof(ArticleId), columnDescription :"文章ID")]
    public long ArticleId { get; set; }
}